home *** CD-ROM | disk | FTP | other *** search
/ Disc to the Future 2 / Disc to the Future Part II Programmer's Reference (Wayzata Technology)(6013)(1992).bin / MAC / MPW_TOOL / TOOLS / TOOLS_WI / ICON_8 / COMMON_F / MEMORY.C < prev    next >
Text File  |  1990-03-02  |  451b  |  31 lines

  1. /*
  2.  * memory.c -- functions to copy and fill memory.
  3.  */
  4.  
  5. #include "::h:config.h"
  6.  
  7. pointer memcopy(to, from, n)
  8.    register char *to, *from;
  9.    register word n;
  10.    {
  11.    register char *p = to;
  12.  
  13.    while (--n >= 0)
  14.       *to++ = *from++;
  15.  
  16.    return (pointer)p;
  17.    }
  18.  
  19. pointer memfill(to, con, n)
  20.    register char *to;
  21.    register con;
  22.    register word n;
  23.    {
  24.    register char *p = to;
  25.  
  26.    while (--n >= 0)
  27.       *to++ = con;
  28.  
  29.    return (pointer)p;
  30.    }
  31.